package com.itgaoshu.service.impl;


import com.itgaoshu.bean.Departments;
import com.itgaoshu.mapper.DepartmentsMapper;
import com.itgaoshu.service.DepartmentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
/**
 * 科室中心
 */
@Service
@Transactional
public class DepartmentsServiceImpl implements DepartmentsService {

    //注入依赖
    @Resource
    private DepartmentsMapper departmentsMapper;
    //查询所有科室
    @Override
    public List<Departments> selectAllDepartments() {
        return departmentsMapper.selectAllDepartments();
    }
    //添加科室
    @Override
    public int addDepartments(Departments departments) {
        return departmentsMapper.addDepartments(departments);
    }
    //模糊查询
    @Override
    public List<Departments> selectDepartments(Departments departments) {
        return departmentsMapper.selectDepartments(departments);
    }

}
